package com.hosever.core;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.hosever.core.model.Page;
import com.hosever.core.model.PageRequest;

public abstract class AbstractServiceImpl<E> 
	implements AbstractService<E>{
	
	@Autowired
	protected AbstractDao<E> dao;
	
	public List<E> list(){
		return dao.list();
	}
	
	public Page<E> page(PageRequest pageRequest){
		return dao.page(pageRequest);
	}
	
	public E findById(String id){
		return dao.findById(id);
	}
	
	public boolean save(E e){
		return dao.save(e);
	}
	
	public boolean update(E e){
		return dao.update(e);
	}
	
	public boolean del(E e){
		return dao.del(e);
	}
	public E customQuerySingle(String hql){
		return dao.customQuerySingle(hql);
	}
	public List<E> customQuery(String hql){
		return dao.customQuery(hql);
	}
}
